package wicket.example.components.table.test.columns;

import org.apache.wicket.Component;
import org.apache.wicket.model.IModel;
import org.apache.wicket.util.io.IClusterable;

public abstract class DataTableColumn<T> implements IClusterable
{

   private static final long    serialVersionUID = 1L;

   private final IModel<String> displayModel;
   private final String         sortPropertyExpression;

   public DataTableColumn(final IModel<String> displayModel)
   {
      this(displayModel, null);
   }

   public DataTableColumn(final IModel<String> displayModel, final String sortPropertyExpression)
   {
      this.displayModel = displayModel;
      this.sortPropertyExpression = sortPropertyExpression;
   }

   public IModel<String> getDisplayModel()
   {
      return displayModel;
   }

   public String getPropertyExpression()
   {
      return sortPropertyExpression;
   }

   public abstract Component getComponent(String componentId, IModel<T> model);

}
